package com.zhb.blog.service;

import com.zhb.blog.dao.UserRepository;
import com.zhb.blog.model.User;
import com.zhb.blog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import sun.security.provider.MD5;

@Service
public class UserServiceImpl  implements UserService{

    @Autowired
    UserRepository userRepository;

    @Override
    public User checkUser(String userName, String password) {
        User user = userRepository.findByUsernameAndPassword(userName, MD5Utils.code(password));


        return user;
    }
}
